Skip to content

GT-2987 Dashboard Personalization: Featured Tools#4411

Merged
frett merged 11 commits into
developfrom
dashboardPersonalizationFeatured
May 6, 2026
Merged

GT-2987 Dashboard Personalization: Featured Tools#4411
frett merged 11 commits into
developfrom
dashboardPersonalizationFeatured

Conversation

@frett

@frett frett commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds personalized_featured_tool_order DB table (schema v27) and getFeaturedToolsFlow() to ToolsRepository for retrieving server-curated featured tools by locale/country
  • Adds syncFeaturedTools() to the sync layer (ToolsApi, ToolSyncTasks, GodToolsSyncService) to fetch and store the featured tool order from the API
  • Extracts spotlight/featured tool flow logic from ToolsPresenter into a new FeaturedToolsFlowProducer — ALL_TOOLS mode uses the existing spotlight filter, PERSONALIZATION mode uses getFeaturedToolsFlow() with a country-based fallback
  • ToolsPresenter now syncs featured tools in parallel with tool order on each sync trigger

Test plan

  • ToolsRepositoryITgetFeaturedToolsFlow() and storeFeaturedToolsFromSync() coverage (6 + 3 tests)
  • ToolSyncTasksTestsyncFeaturedTools() happy path, null country, stale/force variants (4 tests)
  • FeaturedToolsFlowProducerTest — ALL_TOOLS and PERSONALIZATION mode coverage including hidden filter, sort, language/country selection, fallback, and reactivity (13 tests)
  • ToolsPresenterTest — updated for new constructor and sync verification

🤖 Generated with Claude Code

frett and others added 6 commits May 5, 2026 14:46
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@frett frett changed the title Dashboard Personalization: Featured Tools GT-2987 Dashboard Personalization: Featured Tools May 6, 2026
@frett frett added the has tests label May 6, 2026
@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.45977% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.67%. Comparing base (84789e0) to head (62f1cff).

Files with missing lines Patch % Lines
.../cru/godtools/ui/dashboard/tools/ToolsPresenter.kt 70.96% 3 Missing and 6 partials ⚠️
...otlin/org/cru/godtools/sync/GodToolsSyncService.kt 0.00% 3 Missing ⚠️
...kotlin/org/cru/godtools/sync/task/ToolSyncTasks.kt 84.21% 0 Missing and 3 partials ⚠️
...i/src/main/kotlin/org/cru/godtools/api/ToolsApi.kt 0.00% 1 Missing ⚠️
...godtools/db/room/repository/ToolsRoomRepository.kt 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4411      +/-   ##
===========================================
+ Coverage    51.51%   51.67%   +0.15%     
===========================================
  Files          451      453       +2     
  Lines        11976    12014      +38     
  Branches      2066     2079      +13     
===========================================
+ Hits          6170     6208      +38     
+ Misses        5194     5191       -3     
- Partials       612      615       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

frett and others added 4 commits May 6, 2026 09:30
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@frett frett force-pushed the dashboardPersonalizationFeatured branch from b8cb488 to f438ac0 Compare May 6, 2026 15:30
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@frett

frett commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

PR Review

Summary

Adds server-driven featured/spotlight tool personalization to the tools dashboard. Introduces a personalized_featured_tool_order DB table (v27), a /resources/featured API endpoint, FeaturedToolsFlowProducer, and syncFeaturedTools() running in parallel with syncToolOrder(). Refactors ToolsPresenter to use these abstractions and extracts a shared toToolCardState() helper.

Checklist Findings

✅ Looks Good

  • GodToolsRoomDatabase uses AutoMigration(from = 26, to = 27) — no manual migration needed
  • storeFeaturedToolsFromSync and storePersonalizedToolOrderFromSync both @Transaction-wrapped with consistent reset + upsert pattern
  • @Upsert used throughout for sync writes
  • SyncToolPlaceholder shared by both sync paths
  • FeaturedToolsFlowProducer correctly uses distinctUntilChanged() on the combined PERSONALIZATION flow
  • syncFeaturedTools and syncToolOrder run concurrently via coroutineScope { launch; launch }
  • normalizedCountry used consistently for API call, repository store, mutex key, and sync-time key in both syncFeaturedTools and syncToolOrder
  • openToolDetails correctly extracted as a non-@Composable private fun called from event sinks
  • toToolCardState() adds key(tool.code) to the spotlight branch that previously lacked it
  • DAOs use Flow<T> for reactive queries, suspend fun for writes
  • Test coverage comprehensive across FeaturedToolsFlowProducerTest, ToolSyncTasksTest, and ToolsRepositoryIT
  • ktlint: PASS

⚠️ Minor Issues

(none)

❌ Must Fix

(none)

Overall Verdict

APPROVE — Clean, well-tested implementation following all project conventions.

🤖 Reviewed with Claude Code

@frett frett merged commit 5844ed3 into develop May 6, 2026
13 checks passed
@frett frett deleted the dashboardPersonalizationFeatured branch May 6, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant